package com.androidx.p013lv.base.utils;

import com.androidx.p013lv.base.interfaces.Key;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;

/* renamed from: com.androidx.lv.base.utils.AESEncryptUtils */
public class AESEncryptUtils {
    private static String ALGORITHM = "AES";
    private static String CHARSETNAME = "UTF-8";
    private static String CIPHER_ALGORITHM_CBC = "AES/CBC/PKCS7Padding";
    private static String CIPHER_ALGORITHM_ECB = "AES/ECB/PKCS5Padding";

    public static String decrypt(String str) {
        try {
            String substring = SpUtils.getInstance().getString(Key.TOKEN).substring(2, 18);
            SecretKeySpec secretKeySpec = new SecretKeySpec(substring.getBytes(CHARSETNAME), ALGORITHM);
            Cipher instance = Cipher.getInstance(CIPHER_ALGORITHM_CBC);
            instance.init(2, secretKeySpec, new IvParameterSpec(substring.getBytes()));
            return new String(instance.doFinal(Base64Utils.decode2byte(str)));
        } catch (Exception unused) {
            return null;
        }
    }
}
